/*用表格的方式显示算法结果*/
function displayResult(obj, id){
	var $pane = $("#"+id);
	var strHead = "<thead><tr><th>序号</th><th>下一次访问</th><th>寻道次数</th></tr></thead>";
	
	var length = obj.arrProc.length;

	var str = "";
	for(var i=0; i<length; i++){
		str += "<tr><td>"+(i+1)+"</td><td>"+obj.arrProc[i]+"</td><td>"+obj.arrSeNum[i]+"</td></tr>";
	}
	var strBody = "<tbody>"+str+"</tbody";

	var thead = document.createElement("thead");
	var tbody = document.createElement("tbody");

	thead.innerHTML = strHead;
	tbody.innerHTML = strBody;

	var $table = $(document.createElement('table'));
	var $thead = $(thead);
	var $tbody = $(tbody);
	$table.append($thead, $tbody);

	var pAver = document.createElement("p");
	pAver.innerHTML = "平均寻道次数： "+obj.average+" 次";
	var $pAver = $(pAver);

	$pane.append($table, $pAver);
}